Dim expected
Dim replacement
expected = InputBox("Expected current version", "Old Version")
If expected <> "" Then
  replacement = InputBox("New version", "New Version")
End If

If replacement <> "" Then

  Dim cmdline
  cmdline = "ChangeLine /File:..\Deploy\Setup.exe.config"
  cmdline = cmdline & " /Expression:""<add key=\""SolutionVersion\"" value=\""(\d+.\d+.\d+.\d+)\""/>"""
  cmdline = cmdline & " /Expected:" & expected
  cmdline = cmdline & " /Replacement:" & replacement
  cmdline = cmdline & " /Pause"
  Call InvokeProgram(cmdline)

  cmdline = "ChangeLine /File:..\Properties\AssemblyInfo.cs"
  cmdline = cmdline & " /Expression:""AssemblyFileVersion\(\""(\d+.\d+.\d+.\d+)\""\)]"""
  cmdline = cmdline & " /Expected:" & expected
  cmdline = cmdline & " /Replacement:" & replacement
  cmdline = cmdline & " /Pause"
  Call InvokeProgram(cmdline)

  cmdline = "ChangeLine /File:..\12\TEMPLATE\FEATURES\GooJaCharts2007\feature.xml"
  cmdline = cmdline & " /Expression:""Version=\""(\d+.\d+.\d+.\d+)\"""""
  cmdline = cmdline & " /Expected:" & expected
  cmdline = cmdline & " /Replacement:" & replacement
  cmdline = cmdline & " /Pause"
  Call InvokeProgram(cmdline)

End If


Sub InvokeProgram(program)
	Dim fso
	Set fso = CreateObject("Scripting.FileSystemObject")
	Dim shell
	Set shell = CreateObject("WScript.Shell")
	shell.CurrentDirectory=fso.GetParentFolderName(WSCript.ScriptFullName)

	shell.Run program, 1, True
End Sub
